package com.car.rental.vehicle;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SpringBootApplication
@EnableDiscoveryClient
@MapperScan("com.car.rental.vehicle.mapper")
@Component
public class VehicleApplication {
    private static final Logger log = LoggerFactory.getLogger(VehicleApplication.class);

    @Autowired
    private RequestMappingHandlerMapping handlerMapping;

    @PostConstruct
    public void init() {
        handlerMapping.getHandlerMethods().forEach((key, value) -> {
            log.info("注册的接口: {} -> {}", key, value);
        });
    }

    public static void main(String[] args) {
        SpringApplication.run(VehicleApplication.class, args);
    }
} 